package com.atguigu.day08.work;

public enum Payment {
    ALIPAY(1,"扫码支付"),
    WECHAT(2,"扫码支付"),
    CREDIT_CARD(3,"输入卡号支付"),
    DEPOSIT_CARD(4,"输入卡号支付");

    private int value;
    private String description;

    Payment(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public static  Payment pay(int value){
        return Payment.values()[value-1];
    }

    @Override
    public String toString() {
        return name()+description;
    }
}
